#ifndef WEBPARSER_H
#define WEBPARSER_H

#include <QWidget>
#include <QUrl>

class QListWidgetItem;
namespace Jcr
{
class WebParserPrivate;
class WebParser : public QWidget
{
    Q_OBJECT
public:
    explicit WebParser(QWidget *parent = 0);
    ~WebParser();

public slots:
    void setUrl(const QUrl& url);
    QUrl url() const;

    void downloadSelectedItems();

signals:
    void download(const QUrl& url);
    void downloadEnabled(bool enabled);

protected:
    void keyPressEvent(QKeyEvent *e);
    void contextMenuEvent(QContextMenuEvent *e);

private slots:
    void onFinishedParsing();
    void onItemDblClicked(QListWidgetItem* item);
    void onItemClicked(QListWidgetItem* item);
    void onSelectAllChecked(int state);

private:
    WebParserPrivate* d_ptr;
    Q_DISABLE_COPY(WebParser)
};

} // namespace jcr
#endif // WEBPARSER_H
